﻿using System;
using System.Data.Linq.Mapping;

namespace DatabaseStorageDemo.Model
{
   [Table( Name = "Files" )]
   public class DatabaseFile
   {
      [Column( Name = "ID", IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, AutoSync = AutoSync.OnInsert )]
      public int FileId { get; set; }
      [Column( Name = "fileName", CanBeNull = false, DbType = "nvarchar(1000)" )]
      public string FileName { get; set; }
      [Column( Name = "title", CanBeNull = true, DbType = "nvarchar(1000)" )]
      public string Title { get; set; }
      [Column( Name = "subject", CanBeNull = true, DbType = "nvarchar(1000)" )]
      public string Subject { get; set; }
      [Column( Name = "keywords", CanBeNull = true, DbType = "nvarchar(1000)" )]
      public string Keywords { get; set; }
      [Column( Name = "author", CanBeNull = true, DbType = "nvarchar(1000)" )]
      public string Author { get; set; }
      [Column( Name = "creator", CanBeNull = true, DbType = "nvarchar(1000)" )]
      public string Creator { get; set; }
      [Column( Name = "pageCount", CanBeNull = false, DbType = "int" )]
      public int PageCount { get; set; }
      [Column( Name = "modified", CanBeNull = false, DbType = "datetime" )]
      public DateTime LastModified { get; set; }
      [Column( Name = "data", DbType = "Image", CanBeNull = false )]
      public byte[] Data { get; set; }
   }
}
